﻿using Microsoft.AspNetCore.Mvc;
using QiAdmin.Core;
using QiAdmin.Model.Dtos.Input;
using QiAdmin.Service.IService;

namespace QiAdmin.WebApi.Controllers.System
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SysLoginController : ControllerBase
    {
        readonly ITSysUserService _sysUserService;

        public SysLoginController(ITSysUserService sysUserService)
        {
            _sysUserService = sysUserService;
        }


        [HttpPost]
        public ApiJsonResult Login(TSysUser_IN input)
        {
            var res = _sysUserService.Login(input);
            return ApiJsonResult.Convert(res);
        }

        [HttpPost]
        public ApiJsonResult GetCaptcha()
        {
            var res = _sysUserService.GetCaptcha();
            return ApiJsonResult.Convert(res);
        }
    }
}
